<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <base th:href="${#request.getContextPath()}+'/'">
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="stylesheet" type="text/css" th:href="@{/lib/bootstrap/css/bootstrap.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/lib/bootstrap-table/bootstrap-table.min.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/h-ui/css/H-ui.min.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/h-ui.admin/css/H-ui.admin.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/lib/Hui-iconfont/1.0.8/iconfont.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/h-ui.admin/skin/default/skin.css}" id="skin"/>
    <link rel="stylesheet" type="text/css" th:href="@{/h-ui.admin/css/style.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/lib/font-awesome-4.7.0/css/font-awesome.min.css}"/>
</head>
<body>
<nav class="breadcrumb" style="margin-bottom: 5px"><i class="fa fa-cog"></i> 系统管理  <span
        class="c-gray en">&gt;</span> 门诊挂号管理 <span
        class="c-gray en">&gt;</span> 门诊挂号列表
</nav>

<article class="page-container" >

    <form  class="form form-horizontal"  th:action="${registered eq null }  ?'registeredList/insert':'registeredList/update'" method="post" id="form-registered-add">
        <input type="hidden" id="registeredId" value="" name="registeredId" th:value=" ${registered != null} ? ${registered.registeredId}">

                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">挂号编号：</label>
                    <div class="formControls col-xs-8 col-sm-6">
                        <input type="text" class="input-text" th:value="${registered.registeredNumber}" id="registeredNumber" name="registeredNumber">
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">挂号费：</label>
                    <div class="formControls col-xs-8 col-sm-6">
                        <input type="text" class="input-text" th:value="${registered.registrationMoney}" id="regisrationMoney" name="regisrationMoney">
                    </div>
                </div>


                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">科室名称：</label>
                    <div class="formControls col-xs-8 col-sm-6">
                        <span class="select-box" style="width:150px;">
                            <select class="select"  name="deptName" size="1">
                                <option value="">请选择科室</option>
                                <option th:each="dept:${deptName}" th:selected="${registered.deptName} eq ${dept.deptName}"  th:value="${dept.deptName}" th:text="${dept.deptName}"></option>
                            </select>
                        </span>
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">医生名称：</label>
                    <div class="formControls col-xs-8 col-sm-6">
                        <span class="select-box" style="width:150px;">
                            <select class="select" id="doctorName" name="doctorName" size="1">
                                <option value="">请选择医生</option>
                                <option th:each="doctor:${doctors}" th:selected="${registered.doctorName} eq ${doctor.realname}" th:value="${doctor.realname}" th:text="${doctor.realname}"></option>
                            </select>
                        </span>
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">患者姓名：</label>
                    <div class="formControls col-xs-8 col-sm-6">
                        <input type="text" class="input-text" th:value="${registered.patientName}" id="patientName" name="patientName">
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">挂号时间：</label>
                    <div class="formControls col-xs-8 col-sm-6">
                        <span class="select-box" style="width:150px;">
                            <select class="select" th:value="${registered.registeredTime}" name="registeredTime" size="1">
                                <option value="">请选择时间</option>
                                <option th:selected="${registered?.registeredTime} eq '上午'" value="上午">上午</option>
                                <option th:selected="${registered?.registeredTime} eq '中午'" value="中午">中午</option>
                                <option th:selected="${registered?.registeredTime} eq '下午'" value="下午">下午</option>
                            </select>
                        </span>
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">操作员：</label>
                    <div class="formControls col-xs-8 col-sm-6">
                        <input type="text" th:value="${session.doctor.realname}" class="input-text" id="jobName" name="jobName">
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">挂号类别：</label>
                    <div class="formControls col-xs-8 col-sm-6">
                        <span class="select-box" style="width:150px;margin-right: 10px;">
                            <select class="select" id="registrationType" name="registrationType" size="1">
                                <option value="">请选择挂号类别</option>
                                <option th:each="registration:${registrationType}" th:selected="${registered.registrationType} eq ${registration.registrationType}" th:value="${registration.registrationType}" th:text="${registration.registrationType}"></option>
                            </select>
                        </span>
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-4 col-sm-3">状态：</label>
                    <div class="formControls col-xs-8 col-sm-6">
                        <span class="select-box" style="width:150px;">
                            <select class="select" th:value="${registered.status}" name="status" size="1">
                                <option value="">请选择挂号状态</option>
                                <option th:selected="${registered?.status} eq '0'" value="0">未就诊</option>
                                <option th:selected="${registered?.status} eq '1'" value="1">已就诊</option>
                                <option th:selected="${registered?.status} eq '2'" value="2">已退号</option>
                            </select>
                        </span>
                    </div>
                </div>

<!--                <div class="col-xs-4 col-sm-4">-->
<!--                    <label class="form-label col-xs-6 col-sm-6" style="margin-top: 20px;">挂号日期：</label>-->
<!--                    <div class="formControls col-xs-6 col-sm-6" style="margin-top: 20px;">-->
<!--                        <input style="width: 130px;" type="date" class="input-text" value="registeredDate"  placeholder="" id="registeredDate" name="registeredDate">-->
<!--                    </div>-->
<!--                </div>-->


                <div class="row cl">
                    <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                        <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                    </div>
                </div>
            </form>
</article>

<script type="text/javascript" th:src="@{/lib/jquery/1.11.3/jquery.min.js}"></script>
<script type="text/javascript" th:src="@{/lib/layer/2.4/layer.js}"></script>
<script type="text/javascript" th:src="@{/h-ui/js/H-ui.min.js}"></script>
<script type="text/javascript" th:src="@{/h-ui.admin/js/H-ui.admin.js}"></script>
<script type="text/javascript" th:src="@{/lib/jquery.validation/1.14.0/jquery.validate.js}"></script>
<script type="text/javascript" th:src="@{/lib/bootstrap-table/bootstrap-table.min.js}"></script>
<script type="text/javascript" th:src="@{/lib/bootstrap-table/bootstrap-table-zh-CN.min.js}"></script>

<script type="text/javascript">
    $(function () {
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form-registered-add").validate({
            success: "valid",
            submitHandler: function (form) {
                $(form).ajaxSubmit(function (data) {
                    layer.msg(data.msg, {icon: data.code, time: 1000}, function () {
                        //操作成功刷新数据
                        if (data.code == 1) {

                            //刷新父页面表格
                            parent.refresh();
                            //关闭窗口
                            parent.layer.closeAll();
                        }
                    });
                });
            }
        });

    });

</script>




<!--<script type="text/javascript">-->

<!--    $(function(){-->
<!--        //1.为客户下拉框绑定事件-->
<!--        $("#registrationType").change(function () {-->

<!--            //获取客户下拉框被选中 data-base_id的值（基础数据中区间的id）-->
<!--            var registrationType = $("#registrationType option:selected").attr('data-uinqId')-->
<!--            console.log(registrationType)-->

<!--            //获取区间下拉框中的所有的option 并判断base_id的值是否和上面regionId相等，相等选中即可-->
<!--            var options = $("#registrationMoney option");-->

<!--            $.each(options,function (index,option) {-->
<!--                //获取每个option选项的 data-base_id的值-->
<!--                var registrationMoney = $(option).attr('data-uinqId');-->
<!--                if (registrationType == registrationMoney){-->
<!--                    $(option).prop("selected",true);-->
<!--                }-->
<!--            });-->

<!--        });-->

<!--    })-->


<!--</script>-->
</body>
</html>